<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<html:html>
<head>
<html:base />
<title><bean:message key="Application.Name"/></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="css/formas.css" rel="stylesheet" type="text/css">
<script LANGUAGE="JavaScript" type="text/javascript" src="js/AnchorPosition.js"></script>
<script LANGUAGE="JavaScript" type="text/javascript" src="js/PopupWindow.js"></script>
<script LANGUAGE="JavaScript" type="text/javascript" src="js/date.js"></script>
<script LANGUAGE="JavaScript" type="text/javascript" src="js/CalendarPopup.js"></script>
<script language="javascript" type="text/javascript" src="js/util.js"></script>
<script language="javascript" type="text/javascript">
	function fnc_validarForma(forma){
		var bol_retVal = true;
		var str_errores = "";
		
		if(Trim(forma.int_topicNumber.value)==""){
			str_errores += " - <bean:message key='Tema'/> <bean:message key='errors.required'/>\n";
		}else{
			if(!esNumero(forma.int_topicNumber.value,0)){
				str_errores += " - <bean:message key='Tema'/> <bean:message key='errors.integer'/>\n";
			}
		}
		if(Trim(forma.str_descripcion.value)==""){
			str_errores += " - <bean:message key='Document.description'/> <bean:message key='errors.required'/>\n";
		}	
		if( str_errores != "" ){
			bol_retVal = false;
			alert( " <bean:message key='Application.Error(s)'/> : \n" + str_errores );
		}
		return bol_retVal;
	}
	<logic:present name="req_msg">
		alert("<bean:write name='req_msg'/>");
	</logic:present>
</script>
</head>
<body>
	<table cellpadding="0" cellspacing="0" class="formas">
    	<tr>
        	<td>
		   	<table cellpadding="0" cellspacing="0" class="barraNavegacion">
       			<tr>
       			<td><html:link action="/academy_welcome?action=selectAcademy" styleClass="barraNavegacion"><img src="images/icn_liga.gif" border="0"><bean:message key="AcademyWelcome.Init"/></html:link>
			        		<html:link action="/academy_list" styleClass="barraNavegacion"><img src="images/icn_liga.gif" border="0"><bean:message key="Menu.AcademyHeader"/></html:link>
			        		<html:link action="/subject_list" styleClass="barraNavegacion" name="academia" property="map_id"><img src="images/icn_liga.gif" border="0"><bean:message key="StudyPlan.subjects"/></html:link>
			        		<html:link action="/contents_list" styleClass="barraNavegacion" name="materia" property="map_id"><img src="images/icn_liga.gif" border="0"><bean:message key="StudyPlan.subjects.contents"/></html:link>
			        		<html:link  action="/unit_list" styleClass="barraNavegacion" name="materia" property="map_id" ><img src="images/icn_liga.gif" border="0"><bean:message key="Units"/></html:link>
		        </td>
		    </table>
		  	<table cellpadding="0" cellspacing="0" class="titulo">
	        	<tr>
	            	<td class="iconos_imgs"><a href="mailto:<bean:message key="Application.mailto"/>"><img src="images/icn_correo.gif" width="18" height="18" border="0"></a></td>
	               	<td class="txt_titulo"><bean:message key="Tema.content"/></td>
		      	</tr>
          	</table>
 			<html:form action="/topic_save" onsubmit="return fnc_validarForma(this);">	       
	 			<input type="hidden" name="subject_id" value="<bean:write name="materia" property="codigo"/>"/>
		        <input type="hidden" name="academy_id" value="<bean:write name="academia" property="codigo"/>"/>
		        <input type="hidden" name="unit_id" value="<bean:write name="unidad" property="int_unitId"/>"/>
			<table cellpadding="0" cellspacing="2" class="info_formas">
        		<tr> 
          			<td class="formas-txtInfo"><bean:message key="Tema.instructions"/></td>
        		</tr>
        		<table cellpadding="0" cellspacing="2" class="info_titulo">
        			<tr> 
						<td class="formas-encabezado"><bean:message key="StudyPlan.subject.subjectData"/></td>
					</tr>
           			<tr> 
						<td>						
							<table cellpadding="0" cellspacing="2" class="info_titulo">
								<tr> 
									<td class=""><strong><bean:message key="StudyPlan.subject"/></strong></td>
									<td class=""><bean:write name="materia" property="codigo"/> - <bean:write name="materia" property="nombre"/></td>
								</tr>
								<tr> 
									<td class=""><strong><bean:message key="AcademyWelcome.Academy"/></strong></td>
									<td class=""><bean:write name="academia" property="codigo"/> - <bean:write name="academia" property="nombre"/></td>
								</tr>	
								<tr> 
									<td class=""><strong><bean:message key="Unit"/></strong></td>
									<td class=""><bean:write name="unidad" property="int_unitId"/> - <bean:write name="unidad" property="str_descripcion"/></td>
								</tr>					
		            		</table>
	          			<td> 
					</tr>
					<tr> 
						<td class="formas-encabezado"><bean:message key="Tema.add"/></td>
					</tr>
					<tr> 
						<td colspan="3" align="center">
							<table cellpadding="0" cellspacing="2" class="info_titulo">
								<tr> 
									<td class="" ><bean:message key="Tema"/></td>
									<td class="" colspan="5">
										<html:text property="int_topicNumber" size="8"/>
									</td>
								</tr>
								<tr> 
									<td class=""><bean:message key="Tema.description"/></td>
									<td>
										<html:text property="str_descripcion" size="55" maxlength="150"/>							
									</td>
								</tr>
								<tr> 
									<td colspan="6" align="center">
										<div align="center">
											<html:submit property="btn_aceptar"><bean:message key="Application.Accept" /></html:submit>
											<input type="button" onclick="location.href='<html:rewrite action="/topic_lista" name="unidad" property="map_id"/>';" value="<bean:message key='Application.Cancel'/>"/>
										</div>
									</td>
								</tr>
							</table>
						</td>
					</tr>
				</table>
			</html:form>
		</td>
		</table>
	</td>
	</tr>
</table></td>
</body>
</html:html>
